from django.urls import path
from myadmin.views import LoginView, GetResourceAPIView, CreateAdminView, CreateRoleView, CreateResourceView, \
    AddRoleResources, RoleListView, ResourceListView, UpdateRoleResources, DeleteRoleView, LogoutView, \
    GetResourceByRoleView, PositionListView

urlpatterns = [
    path("login/", LoginView.as_view(), name="login"),
    path("create_admin/", CreateAdminView.as_view(), name="create_admin"),
    path("create_role/", CreateRoleView.as_view(), name="create_role"),
    path("create_resource/", CreateResourceView.as_view(), name="create_resource"),
    path("add_role_resources/", AddRoleResources.as_view(), name="add_role_resources"),
    path("get_resource/", GetResourceAPIView.as_view(), name="resource"),
    path("role_list/", RoleListView.as_view(), name="role_list"),
    path("resource_list/", ResourceListView.as_view(), name="resource_list"),
    path("get_resource_by_role/", GetResourceByRoleView.as_view(), name="get_resource_by_role"),
    path("update_role_resources/", UpdateRoleResources.as_view(), name="update_role_resources"),
    path("delete_role/<int:pk>/", DeleteRoleView.as_view(), name="delete_role"),
    path("position_list/", PositionListView.as_view(), name="position_list"),
    path("logout/", LogoutView.as_view(), name="logout"),
]
